package com.prd.controller;

import com.prd.model.EntReport;
import com.prd.model.EntReportCoach;
import com.prd.service.EntReportCoachService;
import com.prd.util.AjaxResult;
import com.prd.util.TableDataInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Api(tags = "汇报指导/辅导")
@RestController
@RequestMapping("/api/entReportCoach")
public class EntReportCoachController extends BaseController {

    @Autowired
    private EntReportCoachService entReportCoachService;

    @ApiOperation("查询列表")
    @GetMapping("list")
    public TableDataInfo list(EntReportCoach entReportCoach) {
        startPage();
        List<EntReportCoach> list = entReportCoachService.listInfo(entReportCoach);
        return getDataPage(list);
    }

    @ApiOperation("添加信息")
    @PostMapping("add")
    public AjaxResult add(@RequestBody EntReportCoach entReportCoach) {
        return toAjax(entReportCoachService.insertInfo(entReportCoach));
    }

    @ApiOperation("修改信息")
    @PostMapping("update")
    public AjaxResult update(@RequestBody EntReportCoach entReportCoach) {
        return toAjax(entReportCoachService.updateInfo(entReportCoach));
    }
}
